import base from './index'
const axios = base.axios
const baseUrl = base.baseUrl



// 获取chatgpt历史对话
export const getChatgptLog = () => {
    return axios({
        method: 'get',
        baseURL: `${baseUrl}/gpt/conversation`,
    }).then(res => res.data.data)
}


// 获取chatgpt历史对话
export const getGptMessage = conversationId => {
    return axios({
        method: 'get',
        baseURL: `${baseUrl}/gpt/message?conversationId=`+ conversationId,
    }).then(res => res.data.data)
}

// 删除chatGPT对话
export const deleteChatgptConversation = id => {
    return axios({
        method: 'delete',
        baseURL: `${baseUrl}/gpt/conversation/` + id,
    })
}


// 重命名chatgpt对话
export const renameChatgptConversation = (conversationId, conversationName) => {
    return axios({
        method: 'put',
        baseURL: `${baseUrl}/gpt/conversation/rename`,
        data: { conversationId, conversationName }
    }).then(res => res.data.data)
}


